import { Node, Vec3, native } from "cc";
export class UserInfo{

    private y:number = 0;
    private lx:number = 0;
    private rx:number = 0;
    private heroPos:Vec3
    private heroLevel:number = 1;
    private interval:number = 0.25;
    
    levelIndex:number=1;
    public bgIndex:number = 1;
    music:string = 'on';
    sound:string = 'on';
    clickCount = 0
    leveldata:any = null
    time = 60
    Tl = 5
    TLTime = 300
    wincount:number = 0
    //第一次提示
    labelNumber:number = 1;
    ISClick:Boolean = false;
    //是否暂停刀片降落
    IsPauseKnife:Boolean = true;
    //是否暂停怪物生成
    IsPauseMonster:Boolean = true;

    //道具1的bool控制角色和怪物不刷新不移动
    ISPropBool:boolean = true;
    private static _instance:UserInfo=null;
    private constructor(){};
   
    
    public static get Instance():UserInfo{
        if(!this._instance){
            this._instance=new UserInfo()
        }
        return  this._instance
    }
    
    setLevelData(data){
        this.leveldata = data
    }
    getLevelData(){
        return  this.leveldata
    }
    set LevelIndex(index:number){
        this.levelIndex=index;
    }
    get LevelIndex():number{
        return this.levelIndex;
    }

    set Y(y:number){
        this.y = y;
    }

    set Lx(lx:number){
        this.lx = lx;
    }

    set Rx(rx:number){
        this.rx = rx;
    }

    set HeroPos(pos:Vec3){
        this.heroPos = pos;
    }

    get HeroPos():Vec3{
        return this.heroPos;
    }

    get HeroLevel():number{
        return this.heroLevel;
    }

    set HeroLevel(level:number){
        this.heroLevel = level;
    }
    set Interval(interval:number){
        this.interval = interval;
    }

    get Interval():number{
        return this.interval;
    }



    isCollierYasuo(own:Vec3):boolean{
        if(own.y <= this.y && own.x <= this.rx && own.x >= this.lx)
        {
            return true;
        }
        return false;
    }

    

    // set Coin(index:number){
    //     this.levelIndex=index;
    // }
    // get Coin():number{
    //     return this.CoinNumber;
    //     }
  

    
    
}

